<?php
    include('../init.php');
    $aid = $_GET['id'];
    $sql = "SELECT * FROM hs_product WHERE p_id= '".$aid."'";
    
    $product_info = $db->queryUniqueObject($sql);
    
    if($product_info->p_img!='' AND file_exists(APPPATH.'/images/products/product/'.$aid.'/'.$product_info->p_img)){
        $productImg = URL.'/images/products/product/'.$product_info->p_id.'/'.$product_info->p_img;
    }else{
        $productImg = URL.'/images/noimg.jpg';
    }
?>
<div id="product_detail">
    <div id="product_detail_close_bt">
        <img src="images/product_list_close_bt.jpg" alt="Close" class="img_link product_detail_close_bt" />
    </div>
    
    <div id="product_detail_img">
        <img src="<?php echo $productImg; ?>" alt="<?php echo $product_info->p_name; ?>" />
    </div>
    <div id="product_detail_">
        <div id="product_detail__">
            <div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
            <div class="viewport">
                <div class="overview">
                    <!--<h2><?php echo strtoupper($product_info->p_style_number); ?></h2>-->
                    <p><?php echo $product_info->p_detail; ?></p>
                    
                    <div class="product_detail">
                        <span>Style Number : </span>
                        <?php if($product_info->p_style_number!=''){echo strtoupper($product_info->p_style_number);}else{echo '-';} ?>
                    </div>
                    <div class="product_detail" style="text-transform:capitalize;">
                        <span>Type : </span>
                        <?php if($product_info->p_type!=''){echo ($product_info->p_type);}else{echo '-';} ?>
                    </div>
                    <div class="product_detail">
                        <span>Metal : </span>
                        <?php if($product_info->p_metal!=''){echo ($product_info->p_metal);}else{echo '-';} ?>
                    </div>
                    <div class="product_detail">
                        <span>Lenght (inch) : </span>
                        <?php if($product_info->p_lenght_inch!=''){echo ($product_info->p_lenght_inch);}else{echo '-';} ?>
                    </div>
                    <div class="product_detail">
                        <span>Lenght (mm) : </span>
                        <?php if($product_info->p_lenght_mm!=''){echo ($product_info->p_lenght_mm);}else{echo '-';} ?>
                    </div>
                    <div class="product_detail">
                        <span>Width (mm) : </span>
                        <?php if($product_info->p_width_mm!=''){echo ($product_info->p_width_mm);}else{echo '-';} ?>
                    </div>
                </div>
            </div>
        </div>
        <div id="product_detail_addcart">
            <a href="cart.php?id=<?php echo $aid; ?>" title="add to cart">add to cart</a>
        </div>
    </div>
</div>
<script>
    $(document).ready(function() {
        $('.product_detail_close_bt').live('click',function(){
            fancybox_close();
        });
    });
</script>
<style>
#fancybox-outer {
 background: #bbbbbb;;
}
.product_detail{
    clear:left;
    margin-top:5px;
    line-height:18px;
}
.product_detail span{
    width:90px;
    padding-right:10px;
    text-align:right;
    float:left;
}
</style>